package com.hushao.aimi.controller;

import com.hushao.aimi.common.ServerResponse;
import com.hushao.aimi.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * @description: 分类控制器
 * @author: 胡少
 * @create: 2018-06-06 11:33
 **/
@Api(value = "分类操作接口")
@RestController
@Slf4j
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;



    @ApiOperation(value = "查询分类信息")
    @GetMapping("/{categoryId}")
    public ServerResponse findCategory(@PathVariable("categoryId") int categoryId) throws Exception{
        return categoryService.findCategory(categoryId);

    }



}

